import { NoSkinCellRenderer } from "../../common/item/NoSkinCellRenderer";
import { FriendRecallItemData } from "../info/FriendRecallItemData";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
import { Language } from "../../../../../extend/language/Language";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { FriendIntimateCellRenderer } from "../../friends/FriendIntimateCellRenderer";
import { ObjCreate } from "../../common/ObjCreate";
import { ImagesConst } from "../../../resource/ImagesConst";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
//class FriendRecallItemRenderer
    
    export  class FriendRecallItemRenderer extends NoSkinCellRenderer
    {
        constructor()
        {
            super();
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            super.data = arg1;
            this._friendItem.data = FriendRecallItemData(data).friendInfo;
            this._levelText.text = FriendRecallItemData(data).friendInfo.friendPlayerInfo.level.toString();
            if (FriendRecallItemData(data).isRecall) 
            {
                this._stateText.htmlText = HTMLUtil.addColor(Language.getString(27734), "#00FF00");
            }
            else 
            {
                this._stateText.htmlText = HTMLUtil.addColor(Language.getString(27733), GlobalStyle.color1);
            }
            return;
        }

        protected /* override */ createChildren(): void
        {
            this._friendItem = new FriendIntimateCellRenderer();
            this._friendItem.mouseEnabled = false;
            this._friendItem.mouseChildren = false;
            this._friendItem.removeBtnBless();
            ObjCreate.setObjAttri(this._friendItem, 5, 0, -1, -1, this);
            this._levelText = ObjCreate.createGTextField("", 175, 10, 30, 20, this);
            this._stateText = ObjCreate.createGTextField("", 215, 10, 40, 20, this);
            ObjCreate.createBg(10, 32, 270, 3, this, ImagesConst.SplitLine);
            return;
        }

        /* internal */ /* var */_friendItem: FriendIntimateCellRenderer;

        /* internal */ /* var */_levelText: GTextFiled;

        /* internal */ /* var */_stateText: GTextFiled;
    }
